home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / initCreateNodeOptionVars.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  5.4 KB  |  180 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. // Copyright (C) 2000 Alias|Wavefront,
  18. // a division of Silicon Graphics Limited.
  19. //
  20. // The information in this file is provided for the exclusive use of the
  21. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  22. // and incorporate this code into other products for purposes authorized
  23. // by the Alias|Wavefront license agreement, without fee.
  24. //
  25. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  26. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  27. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  28. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  29. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  30. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  31. // PERFORMANCE OF THIS SOFTWARE.
  32. //
  33. //
  34. //  Alias|Wavefront Script File
  35. //  MODIFY THIS AT YOUR OWN RISK
  36. //
  37. //  Creation Date:  Date
  38. //  Author:         jdc rendering
  39. //
  40. // Description:
  41. //
  42. //        description
  43. //                                                
  44.  
  45. global proc initCreateNodeOptionVars()
  46. {
  47.     //
  48.     // Description:
  49.     //    This procedure is called when hyperShadePanel.mel is sourced at
  50.     //    startup.
  51.     //    This procedure checks to see that the optionVars which correspond to
  52.     //    create render node options (normal/projection/stencil, with/without
  53.     //    placement, with/without shading group) exist. If they do not exist,
  54.     //    they are created and given default values.
  55.     //
  56.  
  57.     if (!`optionVar -exists createTexturesWithPlacement`)
  58.     {
  59.         optionVar -intValue createTexturesWithPlacement true;
  60.     }
  61.     if (!`optionVar -exists create2dTextureType`)
  62.     {
  63.         optionVar -stringValue create2dTextureType "normal";
  64.     }
  65.     if (!`optionVar -exists createMaterialsWithShadingGroup`)
  66.     {
  67.         optionVar -intValue createMaterialsWithShadingGroup true;
  68.     }
  69. }
  70.  
  71. global proc refreshCreateNodeUI()
  72. {
  73.     //
  74.     // Description:
  75.     //    This procedure is (or is *supposed* to be) called from places which
  76.     //    change the value of create render node options optionVars. 
  77.     //    This procedure refreshes all UI which is currently displaying the state
  78.     //    of any of those option vars.
  79.     //
  80.  
  81.     // Refresh the create render node dialog, if it exists
  82.     //
  83.     if (`window -exists createRenderNodeWindow`)
  84.     {
  85.         setParent createRenderNodeWindow;
  86.  
  87.         // Update the create textures with placement checkbox
  88.         //
  89.         checkBox 
  90.             -edit
  91.             -value `optionVar -query createTexturesWithPlacement` 
  92.             placementCheckBox;
  93.  
  94.         // Update the normal/projection/stencil radiobuttons
  95.         //
  96.         if (`optionVar -query create2dTextureType` == "normal")
  97.         {
  98.             radioButton 
  99.                 -edit
  100.                 -select
  101.                 normalRadioBtn;
  102.         }
  103.         else if (`optionVar -query create2dTextureType` == "projection")
  104.         {
  105.             radioButton 
  106.                 -edit
  107.                 -select
  108.                 projectionRadioBtn;
  109.         }
  110.         else // (`optionVar -query create2dTextureType` == "stencil")
  111.         {
  112.             radioButton 
  113.                 -edit
  114.                 -select
  115.                 stencilRadioBtn;
  116.         }
  117.  
  118.         // Update the create materials with shading groups checkbox
  119.         //
  120.         checkBox 
  121.             -edit
  122.             -value `optionVar -query createMaterialsWithShadingGroup`
  123.             shadingGroupCheckBox;
  124.     }
  125.  
  126.     // Refresh the hypershade menus, if they exist
  127.     //
  128.     // ASSUMPTION:
  129.     // This code assumes that there is only ever a maximum of one
  130.     // hyperShadePanel, and that it is called hyperShadePanel1. If a
  131.     // hyperShadePanel of another name exists, it will not be properly updated.
  132.     //
  133.     if (
  134.             (`panel -exists hyperShadePanel1`) 
  135.         &&     (`panel -query -control hyperShadePanel1` != ""))
  136.     {
  137.         hyperShadePanelRefreshCreateBar("hyperShadePanel1");
  138.         hyperShadePanelRefreshMenu("hyperShadePanel1", "File");
  139.         hyperShadePanelRefreshMenu("hyperShadePanel1", "Create");
  140.     }
  141.  
  142.     // Refresh the visor menus, if they exist
  143.     //
  144.     // ASSUMPTION:
  145.     // This code assumes that there is only ever a maximum of one
  146.     // visorPanel, and that it is called visorPanel1. If a
  147.     // visorPanel of another name exists, it will not be properly updated.
  148.     //
  149.     if (
  150.             (`panel -exists visorPanel1`) 
  151.         &&     (`panel -query -control visorPanel1` != ""))
  152.     {
  153.         setParent visorPanel1;
  154.  
  155.         setParent -menu ("visorPanelMenuFileMenu");
  156.  
  157.         // Update the import textures with placement checkbox
  158.         //
  159.         menuItem
  160.             -edit
  161.             -checkBox 
  162.                 `optionVar -query createTexturesWithPlacement`
  163.                 includePlacementItem;
  164.         
  165.         if (`menu -exists ("visorPopupMenuFileMenu")`)
  166.         {
  167.             setParent -menu ("visorPopupMenuFileMenu");
  168.  
  169.             // Update the import textures with placement checkbox
  170.             //
  171.             menuItem
  172.                 -edit
  173.                 -checkBox 
  174.                     `optionVar -query createTexturesWithPlacement`
  175.                     includePlacementItem;
  176.         }
  177.     }
  178. }
  179.  
  180.